import java.util.Random;

public class Dice {

	private int dice1, dice2, sum;
	private String[] dice = { "images/dice/01.png", "images/dice/02.png", "images/dice/03.png", "images/dice/04.png",
							  "images/dice/05.png", "images/dice/06.png" };
	
	public int getDice1() {
		
		return dice1;
	}
	
	public int getDice2() {
		
		return dice2;
	}
	
	public int getSum() {
		
		return sum;
	}
	
	public void setDice1(int dice1) {
		
		this.dice1 = dice1;
	}
	
	public void setDice2(int dice2) {
		
		this.dice2 = dice2;
	}
	
	public void setSum(int sum) {
		
		this.sum = sum;
	}
	
	public String getDiceURL(int x) {
		
		return 	dice[x];
	}
	
	public void rollDice() {
		
		Random roll = new Random();
		
		do {
		
			this.setDice1(roll.nextInt(7));
			this.setDice2(roll.nextInt(7));
		}
		
		while (this.getDice1() == 0 || this.getDice2() == 0);
		
		this.setSum(this.getDice1()+this.getDice2());
	}
}
